<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>出入库管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../lib/layui-v2.5.4/css/layui.css" media="all">
    <link rel="stylesheet" href="../lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
    <link rel="stylesheet" href="../css/public.css" media="all">
    <style>
    </style>
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-form" >
            <div class="layui-form-item ">
                <div class="layui-form-label">产品类别：</div>
                <div class="layui-input-inline ">
                    <select id="sort" lay-filter="sortFilter">
                        <option value="">--请选择--</option>
                    </select>
                </div>

                <div class="layui-form-label">产品名称：</div>
                <div class="layui-input-inline ">
                    <select id="product" lay-filter="productFilter">
                        <option value="">--请选择--</option>
                    </select>
                </div>

                <div class="layui-form-label">产地：</div>
                <div class="layui-input-inline ">
                    <select id="producta" lay-filter="productaFilter">
                        <option value="">--请选择--</option>
                    </select>
                </div>
            </div>
        </div>
                <div class="layui-inline">
                    <button type="button" class="layui-btn"><i class="layui-icon layui-icon-search"></i>查询</button>
                    <button type="button" class="layui-btn">出库详情</button>
                    <button type="button" class="layui-btn"><a href="productStockSortVo.html">返回上一页</a></button>
                </div>
            </div>
        <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
    </div>
<script src="../lib/layui-v2.5.4/layui.js" charset="utf-8"></script>
<script>
    // 获取上一个链接中的值
    function getUrlParam(name) {
        var url = window.location.href;
        if (url != null && url.indexOf("?") !== -1) {
            var url_param = url.split("?")[1];
            var url_param_arr = url_param.split("&");
            for (var i = 0; i < url_param_arr.length; i++) {
                var tempParam = url_param_arr[i];
                var paramName = tempParam.split("=")[0];
                if (paramName === name) {
                    return tempParam.split("=")[1]
                }
            }
        }
        return null;
    }
    //发个请求给后台拿数据
    layui.use(['form', 'table'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table;
        let pid=getUrlParam("pid");
        table.render({
            elem: '#currentTableId',
            url: '../api/inproduct/ipe?pid='+pid
            ,totalRow: true,
            request: {
                pageName: 'current' //页码的参数名称，默认：page
                , limitName: 'size' //每页数据量的参数名，默认：limit
            },
            cols: [[
                {field: 'pid', title: '编号', sort: true, align: "center", fixed: 'left', unresize: true, totalRowText: '统计数量'},
                {field: 'pname', title: '产品名称', align: "center"},
                {field: 'etruename', title: '入库申请人', align: "center"},
                {field: 'dremark', title: '入库备注', align: "center"},
                {field: 'dint', title: '入库数量', sort: true, align: "center",totalRow: true},
                {field: 'dtime', title: '入库时间', sort: true, align: "center"}
            ]],
            limits: [2, 4, 6, 8, 10, 12],
            limit: 2,
            page: true,
        });
    })
</script>
</body>
</html>